import React, { Component } from 'react'
import { Descriptions, Divider, Table } from 'antd'


// 百融风控
class BairongReport extends Component {
  render() {
    const { brdata1 = {}, brdata2 = {}, brdata3 = {}, brdata4 = {}, brdata5 = {}, brdata6 = {} } = this.props
    const signLess = {
      display: 'flex',
      flexDirection: 'column',
      textAlign: 'left',
      fontSize: 14,
      color: '#333'
    }

    const scoreStandard = (
      <div className={signLess}>
        分值在400到700分之间，分数越高风险越小，根据分数的风险高低，分成ABCD四个等级。
        {/* <span>分值在(0-100)之间，得分越高，风险越小:</span>
        <br />
        <span>[529～999]：A级用户，建议盲发；</span>
        <br />
        <span>[499～529]：B级客户，建议加收一期押金发货；</span>
        <br />
        <span>[480～499]：C级客户，建议加收两期押金发货；</span>
        <br />
        <span>[0～480]：D级客户，无建议；</span> */}
      </div>
    )

    const ExecutionJudColumns = [
      { title: '当事人', dataIndex: 'name' },
      { title: '案件名', dataIndex: 'body' },
      { title: '案件类型', dataIndex: 'dataType' },
      { title: '案件描述', dataIndex: 'caseCause' },
      { title: '案件编号', dataIndex: 'caseNo' },
      { title: '受理法院', dataIndex: 'court' },
      { title: '判决结果', dataIndex: 'judgeResult' },
      { title: '案件时间', dataIndex: 'sortTimeString' },
      // { title: '案件依据', dataIndex: 'foundation' },
    ];


    return (
      <>
        <Divider style={{ fontSize: '24px', color: '#E83F40' }}>
          风险综合评分
        </Divider>
        <br />
        <Descriptions column={4} layout="vertical" bordered>
          <Descriptions.Item label="综合评分">
            <span style={{ fontSize: 20, color: '#333', fontWeight: 'bold' }}>
              {brdata3.score || '-'}
            </span>
          </Descriptions.Item>
          <Descriptions.Item label="风险等级">
            <span style={{ fontSize: 20, color: '#333', fontWeight: 'bold' }}>
              {brdata3.riskLevel || '-'}
            </span>
          </Descriptions.Item>
          <Descriptions.Item label="风控建议">
            {brdata3.riskLevel =='A' ? (
              <span style={{ color: '#07880E', fontSize: 16 }}>{brdata3.riskSuggestion || '-'}</span>
            ) : null}
            {brdata3.riskLevel =='B' ? (
              <span style={{ color: 'gold', fontSize: 16 }}>{brdata3.riskSuggestion || '-'}</span>
            ) : null}
            {brdata3.riskLevel =='C'  ? (
              <span style={{ color: 'gold', fontSize: 16 }}>{brdata3.riskSuggestion || '-'}</span>
            ) : null}
            {brdata3.riskLevel =='D'  ? (
              <span style={{ color: '#FF3C2D', fontSize: 16 }}>{brdata3.riskSuggestion || '-'}</span>
            ) : null}
          </Descriptions.Item>
          <Descriptions.Item label="分值标注说明">
            {scoreStandard}
          </Descriptions.Item>
        </Descriptions>
        <br />
        <Divider style={{ fontSize: '24px', color: '#E83F40' }}>
          历史借贷情况
        </Divider>
        <br />
        <Divider style={{ fontSize: '16px' }}>
          按身份证号查询，近7天申请记录
        </Divider>
        <Descriptions column={3}>
          <Descriptions.Item label="银行机构申请机构数">
            {brdata1.als_d7_id_bank_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="银行机构-传统银行申请机构数">
            {brdata1.als_d7_id_bank_tra_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="银行机构-网络零售银行申请机构数">
            {brdata1.als_d7_id_bank_ret_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构申请机构数">
            {brdata1.als_d7_id_nbank_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌网络小贷机构申请机构数">
            {brdata1.als_d7_id_nbank_nsloan_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌汽车金融机构申请机构数">
            {brdata1.als_d7_id_nbank_autofin_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌小贷机构申请机构数">
            {brdata1.als_d7_id_nbank_sloan_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌消费金融机构申请机构数">
            {brdata1.als_d7_id_nbank_cons_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌融资租赁机构申请机构数">
            {brdata1.als_d7_id_nbank_finlea_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-其他申请机构数">
            {brdata1.als_d7_id_nbank_else_orgnum || '-'}
          </Descriptions.Item>
        </Descriptions>

        <Divider style={{ fontSize: '16px' }}>
          按身份证号查询，近15天申请记录
        </Divider>
        <Descriptions column={3}>
          <Descriptions.Item label="银行机构申请机构数">
            {brdata1.als_d15_id_bank_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="银行机构-传统银行申请机构数">
            {brdata1.als_d15_id_bank_tra_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="银行机构-网络零售银行申请机构数">
            {brdata1.als_d15_id_bank_ret_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构申请机构数">
            {brdata1.als_d15_id_nbank_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌网络小贷机构申请机构数">
            {brdata1.als_d15_id_nbank_nsloan_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌汽车金融机构申请机构数">
            {brdata1.als_d15_id_nbank_autofin_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌小贷机构申请机构数">
            {brdata1.als_d15_id_nbank_sloan_orgnum|| '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌消费金融机构申请机构数">
            {brdata1.als_d15_id_nbank_cons_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌融资租赁机构申请机构数">
            {brdata1.als_d15_id_nbank_finlea_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-其他申请机构数">
            {brdata1.als_d15_id_nbank_else_orgnum || '-'}
          </Descriptions.Item>
        </Descriptions>

        <Divider style={{ fontSize: '16px' }}>
          按身份证号查询，近1个月申请记录
        </Divider>
        <Descriptions column={3}>
          <Descriptions.Item label="银行机构申请机构数">
            {brdata1.als_m1_id_bank_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="银行机构-传统银行申请机构数">
            {brdata1.als_m1_id_bank_tra_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="银行机构-网络零售银行申请机构数">
            {brdata1.als_m1_id_bank_ret_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构申请机构数">
            {brdata1.als_m1_id_nbank_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌网络小贷机构申请机构数">
            {brdata1.als_m1_id_nbank_nsloan_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌汽车金融机构申请机构数">
            {brdata1.als_m1_id_nbank_autofin_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌小贷机构申请机构数">
            {brdata1.als_m1_id_nbank_sloan_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌消费金融机构申请机构数">
            {brdata1.als_m1_id_nbank_cons_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌融资租赁机构申请机构数">
            {brdata1.als_m1_id_nbank_finlea_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-其他申请机构数">
            {brdata1.als_m1_id_nbank_else_orgnum || '-'}
          </Descriptions.Item>
        </Descriptions>

        <Divider style={{ fontSize: '16px' }}>
          按身份证号查询，近3个月申请记录
        </Divider>
        <Descriptions column={3}>
          <Descriptions.Item label="银行机构申请机构数">
            {brdata1.als_m3_id_bank_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="银行机构-传统银行申请机构数">
            {brdata1.als_m3_id_bank_tra_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="银行机构-网络零售银行申请机构数">
            {brdata1.als_m3_id_bank_ret_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构申请机构数">
            {brdata1.als_m3_id_nbank_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌网络小贷机构申请机构数">
            {brdata1.als_m3_id_nbank_nsloan_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌汽车金融机构申请机构数">
            {brdata1.als_m3_id_nbank_autofin_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌小贷机构申请机构数">
            {brdata1.als_m3_id_nbank_sloan_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌消费金融机构申请机构数">
            {brdata1.als_m3_id_nbank_cons_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌融资租赁机构申请机构数">
            {brdata1.als_m3_id_nbank_finlea_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-其他申请机构数">
            {brdata1.als_m3_id_nbank_else_orgnum || '-'}
          </Descriptions.Item>
        </Descriptions>

        <Divider style={{ fontSize: '16px' }}>
          按身份证号查询，近6个月申请记录
        </Divider>
        <Descriptions column={3}>
          <Descriptions.Item label="银行机构申请机构数">
            {brdata1.als_m6_id_bank_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="银行机构-传统银行申请机构数">
            {brdata1.als_m6_id_bank_tra_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="银行机构-网络零售银行申请机构数">
            {brdata1.als_m6_id_bank_ret_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构申请机构数">
            {brdata1.als_m6_id_nbank_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌网络小贷机构申请机构数">
            {brdata1.als_m6_id_nbank_nsloan_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌汽车金融机构申请机构数">
            {brdata1.als_m6_id_nbank_autofin_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌小贷机构申请机构数">
            {brdata1.als_m6_id_nbank_sloan_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌消费金融机构申请机构数">
            {brdata1.als_m6_id_nbank_cons_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌融资租赁机构申请机构数">
            {brdata1.als_m6_id_nbank_finlea_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-其他申请机构数">
            {brdata1.als_m6_id_nbank_else_orgnum || '-'}
          </Descriptions.Item>
        </Descriptions>

        <Divider style={{ fontSize: '16px' }}>
          按身份证号查询，近12个月申请记录
        </Divider>
        <Descriptions column={3}>
          <Descriptions.Item label="银行机构申请机构数">
            {brdata1.als_m12_id_bank_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="银行机构-传统银行申请机构数">
            {brdata1.als_m12_id_bank_tra_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="银行机构-网络零售银行申请机构数">
            {brdata1.als_m12_id_bank_ret_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构申请机构数">
            {brdata1.als_m12_id_nbank_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌网络小贷机构申请机构数">
            {brdata1.als_m12_id_nbank_nsloan_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌汽车金融机构申请机构数">
            {brdata1.als_m12_id_nbank_autofin_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌小贷机构申请机构数">
            {brdata1.als_m12_id_nbank_sloan_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌消费金融机构申请机构数">
            {brdata1.als_m12_id_nbank_cons_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-持牌融资租赁机构申请机构数">
            {brdata1.als_m12_id_nbank_finlea_orgnum || '-'}
          </Descriptions.Item>
          <Descriptions.Item label="非银机构-其他申请机构数">
            {brdata1.als_m12_id_nbank_else_orgnum || '-'}
          </Descriptions.Item>
        </Descriptions>

        <Divider style={{ fontSize: '24px', color: '#E83F40' }}>
          司法涉诉情况
        </Divider>
        <br />
        <Descriptions column={3}>
          <Descriptions.Item label="法院限高">
            <span style={{ fontSize: 16, color: '#333', fontWeight: 'bold' }}>
              {['未命中','命中'][(brdata4 || {}).flag_executionlimited] || '-'}
            </span>
          </Descriptions.Item>
          <Descriptions.Item label="法院被执行">
            <span style={{ fontSize: 16, color: '#333', fontWeight: 'bold' }}>
            {['未命中','命中'][(brdata5 || {}).flag_executionpro] || '-'}
            </span>
          </Descriptions.Item>
          <Descriptions.Item label="司法涉诉">
            <span style={{ fontSize: 16, color: '#333', fontWeight: 'bold' }}>
            {['未命中','命中'][(brdata6 || {}).flag_executionjud] || '-'}
            </span>
          </Descriptions.Item>
        </Descriptions>
        <Descriptions column={2} layout="vertical" bordered>
          <Descriptions.Item label="风险人员">
            <span style={{ fontSize: 16, color: '#333', fontWeight: 'bold' }}>
              {brdata2.result == '0' ? '正常人员': brdata2.result}
            </span>
          </Descriptions.Item>
          <Descriptions.Item label="A、B、C、D、E、F人员说明(正常人员可忽略此说明)">
          <div className={signLess}>
            <span>A 在逃</span>
            <br />
            <span>B 吸毒、涉毒</span>
            <br />
            <span>C 精神病犯罪</span>
            <br />
            <span>D 其他</span>
            <br />
            <span>E Shewen、shekong</span>
            <br />
            <span>F 法院判决文书</span>
          </div>
          </Descriptions.Item>
        </Descriptions>
        <br/>
        <Divider>
          司法涉诉记录
        </Divider>
        <Table
          locale={{ emptyText: '暂无记录' }}
          bordered
          columns={ExecutionJudColumns}
          dataSource={brdata6.ExecutionJud}
          pagination={false}
        />
      </>
    )
  }
}

export default BairongReport
